Add admin-controlled agent card publishing from approved claims#306
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
approved, enabling verified agent discovery without exposing admin actions to the public.Description
db/migrations/003_agent_cards.sqlto extendclaim_agentswithcard_url,card_status,card_published_atand to create a newagent_cardstable with indexes forclaim_id,ens, andcard_url.POST /api/admin/publish-agent-cards(api/admin/publish-agent-cards.js) that requiresADMIN_API_KEY, enforces claimapprovedstatus, is idempotent (returns existing cards if already published), inserts/updatesagent_cards, updatesclaim_agents.card_url/card_status/card_published_at, updatesclaim_requests.statustocards_published, and insertsclaim_eventsandclaim_status_transitionsentries.GET /api/agent-cards/card(api/agent-cards/card.js) that looks up published cards byensorpathand returnscard_jsonasapplication/json, returning404when not found.public/admin/claims.htmlto show aPublish agent cardsbutton when status isapproved, and to show published card URLs plusCopy all card URLs/Open first card/ payment placeholder when status iscards_published.tests/api-admin-publish-agent-cards.test.jscovering missingADMIN_API_KEY, unauthorized requests, non-approved claims, successful publish behavior, idempotency, public card route JSON response, and missing-card404.Testing
npm test; test suite completed successfully with all tests passing (including new publish and public route tests).cd examples/webhook-auto-verify && npm installandnpm run check; both succeeded.npm installin this environment failed due to registry policy (403 Forbiddenfetching@neondatabase/serverless), but tests are structured to mock DB calls and passed locally in CI-style test runs.Codex Task